package com.clear.honghefinance.biz.modules.assist_calculate.domain.dto;


import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 创建辅助核算类别DTO
 */
@Getter
@Setter
public class CreateAssistCalculateCategoryDTO implements Serializable {

    /**
     * 辅助核算类别名称
     */
    @ApiModelProperty(value = "辅助核算类别名称")
    @NotNull(message = "请输入辅助核算类别名称")
    @Size(min = 1, max = 50, message = "辅助核算类别名称长度不能超过50")
    private String name;

    /**
     * 自定义列配置
     */
    @ApiModelProperty(value = "自定义列配置")
    @NotNull(message = "请输入自定义列配置")
    private List<CustomerColumnConfig> customerColumnConfigList;

    @Getter
    @Setter
    public static class CustomerColumnConfig implements Serializable {

        /**
         * 字段名称
         */
        @NotBlank(message = "请输入字段名称")
        @Pattern(regexp = "^(c[1-9]|c10|code|name|notes)$")
        @ApiModelProperty(value = "字段名称，c1,c2,c3,c4,c5,c6,c7,c8,c9,c10")
        private String columnName;

        /**
         * 字段别名
         */
        @NotBlank(message = "请输入字段别名")
        @Size(max = 50, message = "字段别名长度不能超过50")
        @ApiModelProperty(value = "字段别名")
        private String columnAlias;
    }
}
